<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<html>
	<head>
		<%@ include file="/common/header.jsp"%>
	</head>
	<body>
	<!-- 加入这个注释避免当body没有html内容时，在ie下出现空白行	-->
	<nw:Bill templetVO="${templetVO}" bodyGridsPagination="true"/>
	</body>
	<script type="text/javascript">
		var funTree = new uft.extend.tree.Tree({
			treeRootNodeText:'功能节点', //默认根节点名称
			rootVisible : true,
			dataUrl : 'getFunTree.json', //默认数据来源
			isTreeFilter:true
		});
		${moduleName}.appUiConfig.leftTree=funTree;	
		${moduleName}.appUiConfig.treePkField='pk_fun';
		
		MyToolbar = Ext.extend(uft.jf.BodyToolbar, {
			getBtnArray : function(){
				var btns = new Array();
				btns.push(this.btn_edit);
				btns.push(this.btn_save);
				btns.push(this.btn_can);
				btns.push(this.btn_ref);
				btns.push('-');
				btns.push(this.btn_row_add);
				btns.push(this.btn_row_del);
				btns.push(this.btn_row_ins);
				return btns;
			},
			btn_edit_handler : function(){
				var node = funTree.getSelectedNode();
				if(!node || !node.leaf){
					uft.Utils.showWarnMsg('请选择功能菜单树的叶子节点！');
					return false;
				}
				MyToolbar.superclass.btn_edit_handler.call(this);
			},
			getRowDefaultValues : function(gridId){
				var values = MyToolbar.superclass.getRowDefaultValues.call(this,gridId);
				var node = funTree.getSelectedNode();
				var fun_code = node.attributes['code'];
				values['pk_fun'] = node.id;
				values['fun_code'] = fun_code;
				return values;
			}
		});		
		${moduleName}.appUiConfig.toolbar = new MyToolbar(${moduleName}.appUiConfig);
		var app = new uft.jf.ToftPanel(${moduleName}.appUiConfig);
	</script>
	<%@ include file="/common/footer.jsp"%>
</html>
	
